package service;

import dao.UserDao;
import factory.UserDaoFactory;
import model.User;

import java.util.ArrayList;
import java.util.List;

public class UserService{
    private UserDao userDao;

    public UserService() {
        this.userDao = UserDaoFactory.getUserDao();
    }

    public boolean userAddService(User user){
        boolean b = userDao.addUser(user);
        return b;
    }
    public boolean userDeleteService(User user){
        boolean b = userDao.deleteUser(user);
        return b;
    }
    public boolean userUpdateService(User user){
        boolean b = userDao.updateUser(user);
        return b;
    }
    public User userQueryService(User user){
        User user1 = userDao.queryUser(user);
        return user1;
    }
    public List<User> userQueryAllService(){
       List<User> list=userDao.queryAllUser();
       return list;
    }


}
